﻿using IDCardReaderCZ.Struct;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading.Tasks;

namespace IDCardReaderCZ
{
    public class CRTImgprocessDLL
    {
        private static _IDS_SCAN_SETTING m_scanSetting = default(_IDS_SCAN_SETTING);

        [DllImport("libimgprocess.dll", CallingConvention = CallingConvention.StdCall, SetLastError = true)]
        public static extern bool CutIDImage2(char[] front, char[] back);

        [DllImport("kernel32")]
        public static extern long GetPrivateProfileString(string section, string key, string def, StringBuilder retval, int size, string filepath);

        public static void GetScanSetting(out _IDS_SCAN_SETTING set)
        {
            set._iDpi = m_scanSetting._iDpi;
            set._iColor = m_scanSetting._iColor;
            set._iForm = m_scanSetting._iForm;
            set._icom = m_scanSetting._icom;
            set._iScanStatus = m_scanSetting._iScanStatus;
        }

        public static void SetScanSetting(_IDS_SCAN_SETTING set)
        {
            m_scanSetting._iDpi = set._iDpi;
            m_scanSetting._iColor = set._iColor;
            m_scanSetting._iForm = set._iForm;
            m_scanSetting._icom = set._icom;
            m_scanSetting._iScanStatus = set._iScanStatus;
        }
    }
}
